﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="UWarrantyCardAgentAdd.aspx.cs" Inherits="IHISCETeim.Web.AgentSys.SvrMgr.UWarrantyCardAgentAdd" %>
<style>
    .divider{ padding:1px!important; margin:1px!important; }
    .pageFormContent .p,.pageFormContent .dl{height:20px!important;}
    .uwc2div label{width:130px!important;}
</style>
<div class="pageContent">
	<form id="Form1"  action="SvrMgr/UWarrantyCardAgentAdd.aspx?ajaxmethod=add" class="pageForm required-validate" onsubmit="return UWarrantyCardAgentAddvalidateCallback(this,navTabAjaxDone);">
   

    <div class="tabs" currentIndex="0" eventType="click">
		<div class="tabsHeader">
			<div class="tabsHeaderContent">
				<ul>
					<li><a href="javascript:;"><span>保修卡</span></a></li>
					<li><a href="javascript:;"><span>调查表</span></a></li>
				</ul>
			</div>
		</div>
		<div class="tabsContent">
			<div class="pageFormContent" layoutH="90">            
			<p>
				<label>机型：</label>
                <%=GetMacType("select","MachineType","65NS")%>
			</p>
            <p>
				<label>机号：</label>
                   <input type="text" name="SerialNumber" class="required" alt="请输入机号"  />
			</p>
            <p>
				<label>是否是VIP：</label>
                   <input type="checkbox" name="IsVip" value="true"  />
			</p>
            <p>
				<label>是否已交保修卡：</label>
                   <input type="checkbox" name="IsHandCard" value="true"  />
			</p>
             <p>
				<label>关键部件是否延保：</label>
                   <input type="checkbox" name="IsKeepSvr" value="true"  />
			</p>
            <p>
				<label>是否安装破碎器：</label>
                   <input type="checkbox" name="IsBreaker" value="true"  />
			</p>
            <div class="divider"></div>
          
            <p>
				<label>发动机号：</label>
                   <input type="text" name="EngineNumber" class="" alt="请输入发动机编号"  />
			</p>
             <p>
				<label>交机日期：</label>
                   <input type="text" name="IntoDate" class="date required" readonly="true"  format="yyyy-MM-dd"/><a class="inputDateButton" href="javascript:;">选择</a>
			</p>
             <div class="divider"></div>
             
            <p>
				<label>交机小时数：</label>
                 <input type="text" name="IntoHours" class="inputFloat" alt="" value="0"  />
                <span>请勿加h</span>
			</p>
            <p>
				<label>交机地址：</label>
                   <input type="text" name="IntoAddress" class="" alt=""  />
			</p>
             <div class="divider"></div>             
            <dl class="nowrap">
				<dt>特别附件及规格：</dt>
			    <table>
                    <tr>
                        <td>
                            <input type="checkbox" name="IntoSpecial" value="标准式样" />标准式样
                            <input type="checkbox" name="IntoSpecial" value="带破碎管路" />带破碎管路
                            <input type="checkbox" name="IntoSpecial" value="加长臂" />加长臂
                            <input type="checkbox" name="IntoSpecial" value="加宽铲斗" />加宽铲斗
                            <input type="checkbox" name="IntoSpecial" value="其他" />其他
                        </td>
                        <td>
                         <input type="text" name="IntoSpecialOther" class="" alt=""  />   
                        </td>
                    </tr>
                </table>                
			</dl>
            <div class="divider"></div>             
            <dl class="nowrap">
				<dt>使用现场工况：</dt>
			    <table>
                    <tr>
                        <td>
                            <input type="checkbox" name="IntoConditi" value="土方" />土方
                            <input type="checkbox" name="IntoConditi" value="砂石" />砂石
                            <input type="checkbox" name="IntoConditi" value="采石" />采石
                            <input type="checkbox" name="IntoConditi" value="挖砂" />挖砂
                            <input type="checkbox" name="IntoConditi" value="造园" />造园
                            <input type="checkbox" name="IntoConditi" value="其他" />其他
                        </td>
                        <td>
                         <input type="text" name="IntoConditiOther" class="" alt=""  />   
                        </td>
                    </tr>
                </table>                
			</dl>
           <div class="divider"></div>  
           <p>
				<label>客户姓名：</label>
                   <input type="text" name="CustomerName" class="required" alt="请输入客户姓名"  />
			</p>
             <p>
				<label>客户电话：</label>
                   <input type="text" name="CustomerTel" class="" alt=""  />
			</p>
            <div class="divider"></div>  
            <dl class="nowrap">
				<dt>客户手机：</dt>
                <dd><input type="text" name="CustomerMobile" class="required" alt=""  size="50"/></dd>
            </dl>
            <div class="divider"></div>  
            <dl class="nowrap">
				<dt>客户身份证：</dt>
                <dd><input type="text" name="CustomerIDCard" class="idcard required" alt="" size="50" /></dd>               
            </dl>
            <dl class="nowrap">
                 <dt>生日：</dt>
                <dd><input type="text" name="Birthday" class="date" readonly="readonly" format="MM-dd" yearstart="-80" yearend="-10" alt=""  /></dd>
            </dl>
            <div class="divider"></div>  
            <dl class="nowrap">
				<dt>客户详细地址：</dt>    
                <table>
                    <tr>
                        <td valign="bottom">
                        <input type="text" name="CustomerAddress" class="required" alt="" size="5"  />省
                        </td>
                        <td>
                        <input type="text" name="CustomerAddress" class="required" alt="" size="5"  />市
                        </td>
                        <td>
                        <input type="text" name="CustomerAddress" class="required" alt="" size="5"  />县(街)
                        </td>
                        <td>
                        <input type="text" name="CustomerAddress" class="required" alt="" size="5"  />乡(镇)
                        </td>
                        <td>
                        <input type="text" name="CustomerAddress" class="" alt="" size="5"  />村
                        </td>
                    </tr>
                </table>
            </dl>
        <div class="divider"></div>  
                   <%if(HasPower(IHISCETeim.Web.Permission.经销商平台_公司人员)){ %>   
           <p>
				<label>经销商名称：</label>
               
                  
                 <input type="text" name="dwz.orgLookup.AgentName" class="required textInput autocomplete" alt=""
                        size="30"   autocompletehref="<%=AutoCompleteRequestUrl %>?ajaxmethod=getagentlist" swidth="300" showinputid="UWarrantyCardAdd_AgentAddress"/>
                    <a class="btnLook" href="/MachineSys/SAPAgentListLookUp.aspx" lookupgroup="orgLookup"
                        maxable="false" width="600" resizable="false" title="经销商列表">
                        <hi:text key="查找带回" />
                    </a>
               
                 
			</p>
            <dl class="nowrap">
				<dt>经销商地址：</dt>                
                <dd><input type="text" id="UWarrantyCardAdd_AgentAddress" name="dwz.orgLookup.AgentAddress" class="" alt="" size="90"  /></dd>               

            </dl>
            <div class="divider"></div>  
 <%} %>
             <p>
				<label>服务电话：</label>
                   <input type="text" name="AgentTel" class="" alt=""  />
			</p>
           <div class="divider"></div>  
           <p>
				<label>交机服务人员：</label>
                   <input type="text" name="AgentSvrPer" class="" alt=""  />
			</p>
             <p>
				<label>交机人电话：</label>
                   <input type="text" name="AgentSvrPerTel" class="" alt=""  />
			</p>
            <div class="divider"></div>  
            <dl class="nowrap">
				<dt>质保期限：</dt>
                <dd>
                    <select name="zipaoqixian">
                        <option value="0" selected>请选择</option>
                        <option value="1" >12个月不限小时</option>
                        <option value="2">15个月或2000小时(说明:仅限黑、辽、甘、宁、蒙、新、青、藏区域)</option>
                    </select>
                </dd>
            </dl>
            <div class="divider"></div>  
            <dl class="nowrap">
				<dt>备注：</dt>
                <dd>
                <textarea  name="Remark"  cols="60" rows="5" ></textarea>
                </dd>
            </dl>
            <div class="divider"></div>  
            <table style=" border-spacing:5px;">
                <tr>
                    <td style="vertical-align:top;width:140px;">保修卡正面扫描件：</td>
                    <td>
                         <input type="hidden" name="ScanImg1" id="UWarrantyCardAgentAddScanImg1" />
                         <img id="UWarrantyCardAgentAddimgShow1" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="ScanImg1upload" uploadify="uploadify" clientId="UWarrantyCardAgentAddScanImg1,UWarrantyCardAgentAddimgShow1" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddScanImg1','UWarrantyCardAgentAddimgShow1')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>
                    <td style="vertical-align:top;width:140px; text-align:right;">保修卡反面扫描件：</td>
                    <td>
                         <input type="hidden" name="ScanImg2" id="UWarrantyCardAgentAddScanImg2" />
                         <img id="UWarrantyCardAgentAddimgShow2" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td> <input type="file" name="filedata" id="ScanImg2upload" uploadify="uploadify" clientId="UWarrantyCardAgentAddScanImg2,UWarrantyCardAgentAddimgShow2" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddScanImg2','UWarrantyCardAgentAddimgShow2')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>
                </tr>
                <tr>
                    <td style="vertical-align:top;width:140px;">机号照片：</td>
                    <td>
                         <input type="hidden" name="ScanImgJiHao" id="UWarrantyCardAgentAddScanImgJiHao" />
                         <img id="UWarrantyCardAgentAddScanImgJiHaoShow" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="ScanImgJiHaoupload" uploadify="uploadify" clientId="UWarrantyCardAgentAddScanImgJiHao,UWarrantyCardAgentAddScanImgJiHaoShow" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddScanImgJiHao','UWarrantyCardAgentAddScanImgJiHaoShow')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>
                    <td style="vertical-align:top;width:140px; text-align:right;">工作小时照片：</td>
                    <td>
                         <input type="hidden" name="ScanImgWorkTime" id="UWarrantyCardAgentAddWorkTime" />
                         <img id="UWarrantyCardAgentAddWorkTimeShow" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td> <input type="file" name="filedata" id="WorkTimeupload" uploadify="uploadify" clientId="UWarrantyCardAgentAddWorkTime,UWarrantyCardAgentAddWorkTimeShow" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddWorkTime','UWarrantyCardAgentAddWorkTimeShow')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>                    
                </tr>
                <tr>
                    <td style="vertical-align:top;width:140px;">交机人员、客户及机器合影：</td>
                    <td>
                         <input type="hidden" name="ScanImgHeYing" id="UWarrantyCardAgentAddHeYing" />
                         <img id="UWarrantyCardAgentAddHeYingShow" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="HeYingupload" uploadify="uploadify" clientId="UWarrantyCardAgentAddHeYing,UWarrantyCardAgentAddHeYingShow" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddHeYing','UWarrantyCardAgentAddHeYingShow')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>
                    <td style="vertical-align:top;width:140px; text-align:right;">
                        交机热烈场景照片
                    </td>
                    <td>
                         <input type="hidden" name="ScanImgJiaJi" id="UWarrantyCardAgentAddScanImgJiaJi" />
                         <img id="UWarrantyCardAgentAddScanImgJiaJiShow" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="JiaJiupload" uploadify="uploadify" clientId="UWarrantyCardAgentAddScanImgJiaJi,UWarrantyCardAgentAddScanImgJiaJiShow" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddScanImgJiaJi','UWarrantyCardAgentAddScanImgJiaJiShow')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>                    
                </tr>
                 <tr>
                    <td style="vertical-align:top;width:140px;">破碎器安装报告：</td>
                    <td>
                         <input type="hidden" name="ScanImgPuoChui" id="UWarrantyCardAgentAddScanImgPuoChui" />
                         <img id="UWarrantyCardAgentAddScanImgPuoChuiShow" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="ScanImgPuoChuiupload" uploadify="uploadify" clientId="UWarrantyCardAgentAddScanImgPuoChui,UWarrantyCardAgentAddScanImgPuoChuiShow" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddScanImgPuoChui','UWarrantyCardAgentAddScanImgPuoChuiShow')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>
                    <td style="vertical-align:top;width:140px; text-align:right;">
                       
                    </td>
                    <td>
                        
                    </td>                    
                </tr>
                 <tr>
                    <td style="vertical-align:top;width:140px;">延保协议1：</td>
                    <td>
                         <input type="hidden" name="ScanImgYuanBao1" id="UWarrantyCardAgentAddScanImgYuanBao1" />
                         <img id="UWarrantyCardAgentAddScanImgYuanBao1Show" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="ScanImgYuanBao1upload" uploadify="uploadify" clientId="UWarrantyCardAgentAddScanImgYuanBao1,UWarrantyCardAgentAddScanImgYuanBao1Show" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddScanImgYuanBao1','UWarrantyCardAgentAddScanImgYuanBao1Show')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>
                    <td style="vertical-align:top;width:140px; text-align:right;">
                        延保协议2
                    </td>
                    <td>
                          <input type="hidden" name="ScanImgYuanBao2" id="UWarrantyCardAgentAddScanImgYuanBao2" />
                         <img id="UWarrantyCardAgentAddScanImgYuanBao2Show" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="ScanImgYuanBao2upload" uploadify="uploadify" clientId="UWarrantyCardAgentAddScanImgYuanBao2,UWarrantyCardAgentAddScanImgYuanBao2Show" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddScanImgYuanBao2','UWarrantyCardAgentAddScanImgYuanBao2Show')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>                    
                </tr>
                <tr>
                    <td style="vertical-align:top;width:140px;">燃油系统防护告知书1：</td>
                    <td>
                         <input type="hidden" name="LYXTFHGZS1" id="UWarrantyCardAgentAddLYXTFHGZS1" />
                         <img id="UWarrantyCardAgentAddLYXTFHGZS1Show" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="LYXTFHGZS1upload" uploadify="uploadify" clientId="UWarrantyCardAgentAddLYXTFHGZS1,UWarrantyCardAgentAddLYXTFHGZS1Show" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddLYXTFHGZS1','UWarrantyCardAgentAddLYXTFHGZS1Show')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>
                    <td style="vertical-align:top;width:140px; text-align:right;">
                        燃油系统防护告知书2
                    </td>
                    <td>
                          <input type="hidden" name="LYXTFHGZS2" id="UWarrantyCardAgentAddLYXTFHGZS2" />
                         <img id="UWarrantyCardAgentAddLYXTFHGZS2Show" src=""  Width="150" Height="150"/>
                         <table border="0">
                                   <tr>
                                       <td><input type="file" name="filedata" id="LYXTFHGZS2upload" uploadify="uploadify" clientId="UWarrantyCardAgentAddLYXTFHGZS2,UWarrantyCardAgentAddLYXTFHGZS2Show" dirtype="5" foldername="<%=User.Department %>" onUploadSuccess="onUWarrantyCardAgentAddUploadFileSuccess" fileSizeLimit="1MB"/></td>
                                       <td><a href="#" onclick="onUWarrantyCardAgentAddDeleteUpload('UWarrantyCardAgentAddLYXTFHGZS2','UWarrantyCardAgentAddLYXTFHGZS2Show')" >删除</a></td>
                                   </tr>
                          </table>
                    </td>                    
                </tr>
                <tr>
                    <td colspan="3" style="font-weight:bold;color:red; padding:2px 10px;">
                        交机人员非服务人员或无着工作服进行规范服务，将扣除100元交机费用
                    </td>
                </tr>
            </table>
           
    </div>
			<div class="pageFormContent uwc2div" layoutH="90">
                <%=GetUQuestionTemplete() %>
            </div>		
		</div>
		<div class="tabsFooter">
			<div class="tabsFooterContent"></div>
		</div>
	</div>

    <div class="formBar">
   
			<ul>
				<li id="UWarrantyCardAgentAddbtnSave"><div class="buttonActive"><div class="buttonContent">                 
                    <button type="submit">保存</button></div></div></li>
				<li><div class="button"><div class="buttonContent"><button type="button" class="close">取消</button></div></div></li>
			</ul>
		</div>
       
	</form>
    </div>
<script>
    function onUWarrantyCardAgentAddDeleteUpload($objHide, $objImg)
    {
       // $(obj).closest("table").closest("td").find(":hidden").val("");
        //$(obj).closest("table").closest("td").find("img").attr("src", "");
        $("#" + $objHide).val("");
        $("#" + $objImg).attr("src", "");

       // $("#UWarrantyCardAgentAddScanImg" + index).val("");
       // $("#UWarrantyCardAgentAddimgShow" + index).attr("src", "");;
    }
    function onUWarrantyCardAgentAddUploadFileSuccess(file, data, response) {
        if (!response)
            return false;
        data = eval("(" + data + ")");
        if (!data.uploadResult) {
            alert(data.errMsg);
            return;
        }
        var $imgUploadPath = data.filePath;
        var $trageIds = data.customerInfo.split(",");        
        $("#" + $trageIds[0]).val($imgUploadPath);
        $("#" + $trageIds[1]).attr("src", $imgUploadPath);
    }
    function UWarrantyCardAgentAddvalidateCallback(form, callback) {
        var $form = $(form);
        var nextTimeIndex = 10;
        var nexttimer = window.setInterval(function () {
            $("#UWarrantyCardAgentAddbtnSave").find("button").attr("disabled", "disabled").html("保存中" + (nextTimeIndex--));
        }, 1000);
       

        
        setTimeout(function () { $("#UWarrantyCardAgentAddbtnSave").find("button").removeAttr("disabled").html(" 保 存 "); clearInterval(nexttimer) }, 10000);
        //  return false;
        return validateCallback(form, callback);
    }
</script>